import { T_srv, Tsrv, ifs, ts, tvs, vue } from '@/services';
import { I_cmd, T_cmd } from './command';
import { N_cPaintCodeGuide } from './type';

// 喷漆编码向导配置JSON
const paintCodeGuideConfig = (): N_cPaintCodeGuide.PaintCodeGuideConfig => ({
  modalTitle: "paint_code_guide",
  partInfoFields: [
    {
      field: "fpart_no",
      label: "fpart_no",
      dataKey: "partNumber"
    },
    {
      field: "fpart_ver",
      label: "fpart_ver", 
      dataKey: "processRevision"
    },
    {
      field: "m2o|pro_mach_id|mach_type_info|pro_mac_type",
      label: "pro_mac_type",
      dataKey: "processModel"
    },
    {
      field: "fpart_name",
      label: "fpart_name",
      dataKey: "partName"
    },
    {
      field: "slc|typ_proc|441187226068459520",
      label: "typ_proc",
      dataKey: "surfaceType"
    }
  ],
  tableConfig: {
    columns: [
      {
        type: "checkbox",
        field: "checkbox",
        title: "",
        width: 60
      },
      {
        field: "index",
        title: "sn",
        width: 80
      },
      {
        field: "surface", 
        title: "surface"
      },
      {
        field: "paintName",
        title: "paint_bom",
        editor: {
          type: "m2o-selector",
          tField: "paint_material_code",
          tTable: "spray_painting_archives",
          isFunLayout: true
        }
      }
    ]
  },
  buttons: [
    {
      type: "primary",
      text: "add_paint_spraying_record"
    },
    {
      type: "error", 
      text: "delete"
    },
    {
      type: "success",
      text: "save_paint_code"
    }
  ],
  tips: {
    icon: "ios-alert",
    text: "hint",
    content: "front_hang_group_face_workers"
  },
  displaySections: [
    {
      title: "paint_diagram",
      dataKey: "paintSequence"
    },
    {
      title: "paint_code", 
      dataKey: "paintCode"
    }
  ]
});

export { I_cmd, N_cPaintCodeGuide, T_cmd, T_srv, Tsrv, ifs, paintCodeGuideConfig, ts, tvs, vue };
